import React from 'react'
import {HashRouter as Router, Route, Switch} from 'react-router-dom'
import Main from '../route1/Main'
import About from '../route1/About'
import Topic from '../route1/Topic'
import Info from './info'
import Page from './Page'
import NoMatch from './nomatch'
export default class IRouter extends React.Component{

  render () {
    return (
      <Router>
        <Page>
          <Switch>
            <Route path='/home' render={()=>{
              return (
                <Main>
                  <Route path='/home/:id' component={Info}></Route>
                </Main>
              )
            }}></Route>
            <Route path='/about' component={About}></Route>
            <Route exact={true} path='/about/a' component={About}></Route>
            <Route path='/topic' component={Topic}></Route>
            <Route component={NoMatch}></Route>
          </Switch>
        </Page>
      </Router>
    )
  }
}